package com.tbit.manager.api;

import com.tbit.manager.api.dto.OrderFunnelDTO;
import com.tbit.manager.api.dto.OrderStatReturnDTO;
import com.tbit.manager.enums.ApiConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

@FeignClient(name = ApiConstants.NAME)
public interface OrderOAApi {

    String PREFIX = ApiConstants.PREFIX + "/operationsAnalysis/order";

    /**
     * @description: 获取车辆订单的统计数据（订单收益、订单量、车均收益等）
     * @author: mo.shanyong
     * @date: 2025/3/7 13:39
     * @param: accountId 区域Id
     * @param: startDate 筛选开始时间
     * @param: endDate 筛选结束时间
     * @return: java.util.Map<java.lang.String, java.lang.Object>
     */
    @GetMapping(value = PREFIX + "/getOrderBaseData")
    Map<String,Object> getOrderBaseData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);

    /**
     * @description: 获取订单收益折线图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 13:43
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: java.util.List<com.tbit.manager.api.dto.OrderStatReturnDTO>
     */
    @GetMapping(value = PREFIX + "/getOrderFeeLineData")
    List<OrderStatReturnDTO> getOrderFeeLineData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);

    /**
     * @description: 订单量折线图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 13:51
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: java.util.List<com.tbit.manager.api.dto.OrderStatReturnDTO>
     */
    @GetMapping(value = PREFIX + "/getOrderNumLineData")
    List<OrderStatReturnDTO> getOrderNumLineData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);

    /**
     * @description: 车均收益折线图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 13:51
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: java.util.List<com.tbit.manager.api.dto.OrderStatReturnDTO>
     */
    @GetMapping(value = PREFIX + "/getMachineAvgFeeLineData")
    List<OrderStatReturnDTO> getMachineAvgFeeLineData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);

    /**
     * @description: 车均单量折线图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 14:56
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: java.util.List<com.tbit.manager.api.dto.OrderStatReturnDTO>
     */
    @GetMapping(value = PREFIX + "/getMachineAvgOrderLineData")
    List<OrderStatReturnDTO> getMachineAvgOrderLineData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);

    /**
     * @description: 正常、站外、超区订单折线图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 15:03
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: com.tbit.manager.api.dto.OrderStatReturnDTO
     */
    @GetMapping(value = PREFIX + "/getOrderFinishTypeData")
    List<OrderStatReturnDTO> getOrderFinishTypeData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);


    /**
     * @description: 车辆平均里程饼图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 15:06
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: java.util.List<com.tbit.manager.api.dto.OrderStatReturnDTO>
     */
    @GetMapping(value = PREFIX + "/getOrderMileagePieData")
    List<OrderStatReturnDTO> getOrderMileagePieData(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);


    /**
     * @description: 获取订单支付方式饼图数据
     * @author: mo.shanyong
     * @date: 2025/3/7 15:11
     * @param: accountId 区域id
     * @param: startDate 开始时间
     * @param: endDate 结束时间
     * @return: com.tbit.manager.api.dto.OrderStatReturnDTO
     */
    @GetMapping(value = PREFIX + "/getOrderPayTypePieData")
    List<OrderStatReturnDTO> getOrderPayTypePieData(@RequestParam("accountId") Integer accountId, @RequestParam(value = "startDate") String startDate,
                                                    @RequestParam(value = "endDate") String endDate);

    /**
     * @description: 获取时间段内区域的订单的骑行时长的分布数据
     * @author: mo.shanyong
     * @date: 2025/3/14 9:11
     * @param: accountId 区域id
     * @param: startDate 开始时间 2025-03-01 00:00:00
     * @param: endDate 结束时间 2025-03-01 23:59:59
     * @return: java.util.List<com.tbit.manager.api.dto.OrderStatReturnDTO>
     */
    @GetMapping(value = PREFIX + "/getOrderTimeDistribution")
    List<OrderStatReturnDTO> getOrderTimeDistribution(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);

    /**
     * @description: 获取订单转换数据
     * @author: mo.shanyong
     * @date: 2025/4/17 11:21
     * @param: accountId 区域id
     * @param: startDate 筛选开始时间
     * @param: endDate  筛选结束时间
     * @return: com.tbit.manager.api.dto.OrderFunnelDTO
     */
    @GetMapping(value = PREFIX + "/orderAnalysisFunnel")
    OrderFunnelDTO orderAnalysisFunnel(@RequestParam("accountId") Integer accountId, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);


}
